import { axios } from '@/utils/request'

export function selectParentMenu () {
  return axios({
    url: '/system/menu/selectParentMenu',
    method: 'get'
  })
}

export function selectPage (parameter) {
  return axios({
    url: '/system/menu/list',
    method: 'get',
    params: parameter
  })
}

export function selectAll (parameter) {
  return axios({
    url: '/system/menu/getAll',
    method: 'get'
  })
}

export function selectByRoleId (roleId) {
  return axios({
    url: '/system/menu/getByRoleId/' + roleId ,
    method: 'get'
  })
}

export function saveOrUpdate (parameter) {
  return axios({
    url: '/system/menu/saveOrUpdate',
    method: 'post',
    data: parameter
  })
}

export function del (id) {
  return axios({
    url: '/system/menu/' + id,
    method: 'delete'
  })
}

export function updateOther (parameter) {
  return axios({
    url: '/system/menu/updateOther',
    method: 'post',
    params: parameter
  })
}
